#!/usr/bin/python
import linecache

class Parser:
	Lines = []
	L = 0
	Filename = ""
	def formatLine(self,String):
		Pos = 0
		Line = []
		for i in range(len(String)):
			if String[i:i+1] == " ":
				Line.append(String[Pos:Pos+(i-Pos)])
				Pos = i+1
			if i == len(String)-1:
				Line.append(String[Pos:Pos+(i-Pos)])
		self.Lines.append(Line)	
	def __init__(self,Filename):
		self.Filename = Filename
		File = open(Filename)
		self.L = len(File.readlines())
		File.close()			
	def doParse(self):
		if self.L>0:
			A = 1
			while self.L>=A:
				Line = linecache.getline(self.Filename,A)
				self.formatLine(Line)
				A+=1
pass
